//
//  Myscroler.m
//  Protect -A
//
//  Created by 付剑英 on 16/6/16.
//  Copyright © 2016年 付剑英. All rights reserved.
//

#import "Myscroler.h"

@implementation Myscroler

-(instancetype)initWithFrame:(CGRect)frame withImages:(NSArray<UIImage*>*)images{
    self = [super initWithFrame:frame];
    if (self) {
        
    }
    return self;
}

-(void)configWithFrame:(CGRect)frame withImages:(NSArray<UIImage*>*)images{
    self.contentSize = CGSizeMake(frame.size.width*images.count, 0);
    //创建imageview子视图
    for (int i = 0; i < images.count; i ++) {
        UIImageView *imageview = [[UIImageView alloc]initWithImage:images[i]];
        imageview.frame = CGRectMake(frame.size.width*i, 0, frame.size.width, frame.size.height);
        [self addSubview:imageview];
        [imageview release];
    }
    //翻页效果
    self.pagingEnabled = YES;
    //边缘回弹
    self.bounces = YES;
    
}







@end
